package com.xltt.watchlauncher3.adapter;

import android.widget.BaseAdapter;

import java.util.List;

/**
 * Created by Administrator on 2018/12/29.
 */

public abstract class ListViewBaseAdapter<T> extends BaseAdapter {

    protected List<T> mData = null;

    @Override
    public int getCount() {
        return mData == null || mData.isEmpty() ? 0 : mData.size();
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public T getItem(int position) {
        return mData == null || mData.isEmpty() ? null : mData.get(position);
    }

    public void setData(List<T> items) {
        mData = items;
    }


    public List<T> getData(){
        return mData;
    }

}
